package com.tianji.learning.mapper;

import com.tianji.learning.domain.po.PointsRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianji.learning.domain.vo.PointsStatisticsVO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 学习积分记录，每个月底清零 Mapper 接口
 * </p>
 *
 * @author xjs
 */
public interface PointsRecordMapper extends BaseMapper<PointsRecord> {
    int sumUserPoints(@Param("userId") Long userId,
                      @Param("type")int type,
                      @Param("begin")LocalDateTime begin,
                      @Param("end")LocalDateTime end);

    List<PointsStatisticsVO> todayUserPoints(@Param("userId") Long userId,
                                             @Param("begin")LocalDateTime begin,
                                             @Param("end")LocalDateTime end);

}
